When an electric current passes near a compass, it changes position. The electric currents generate a magnetic field around them. This phenomenon was  discovered by Öersted.

 
The visual in context

Licencia de Creative Commons
Except where otherwise noted, this work is licensed under a Creative Common License